package com.shop.loan.model;

import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.ViewType;
import xyz.erupt.annotation.sub_field.sub_edit.AttachmentType;
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
import xyz.erupt.annotation.sub_field.sub_edit.VL;
import xyz.erupt.jpa.model.MetaModelCreateVo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;


@Setter
@Getter
@Entity
@Table(name = "s_loan_order_attachment")
@Erupt(
        name = "订单附件信息",
        authVerify = false

)
@ApiModel("订单附件信息")
public class LoanOrderAttachment extends MetaModelCreateVo {


    @Column(name = "order_id")
    private Long orderId;

    @EruptField(
            views = @View(title = "类型", width = "150px"),
            edit = @Edit(
                    title = "类型",
                    type = EditType.CHOICE,
                    placeHolder = "请选择附件类型",
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(label = "身份证照片", value = "1"),
                                    @VL(label = "订单确认聊天截图", value = "2"),
                                    @VL(label = "贷款合同", value = "3"),
                                    @VL(label = "债转合同", value = "4"),
                                    @VL(label = "平台订单页面截图", value = "5"),
                                    @VL(label = "用户微信信息页", value = "6"),
                                    @VL(label = "其他", value = "99"),
                            }
                    ))
    )
    private Integer type;

    @EruptField(
            views = @View(title = "附件", type = ViewType.IMAGE),
            edit = @Edit(title = "附件",
                    type = EditType.ATTACHMENT,
                    notNull = true,
                    attachmentType = @AttachmentType(
                            type = AttachmentType.Type.IMAGE,
                            maxLimit = 5))
    )
    private String info;


    @EruptField(
            views = @View(title = "备注", width = "300px"),
            edit = @Edit(title = "备注")
    )
    private String remark;

}
